<?php

namespace App\Http\Resources;

class EventResource extends JsonResource
{
    public const FOR_EDIT = 'edit';
    public function toArray($request)
    {
        $data=parent::toArray($request);
        $data = array_merge($data, [
            'category' => $this->whenLoaded('category'),
        ]);
        return $data;
    }
}
